<template>
  <a-card class="cardShadow">
    <a-spin :spinning="confirmLoading">
      <a-form :form="form" layout="inline">
        <a-row :gutter="[16,24]">
          <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="工业"
              style="width: 100%">
              <a-input v-decorator="['totalEnergyConsumption', {
            rules: [
              {
                required: true,
                message: '仅能输入数字和两位小数，不能为空或为负数！',
                pattern: /^[0-9]+\.?[0-9]{0,2}$/
              },
            ],
          }]" placeholder="请输入工业的值" suffix=""/>
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="批发和零售业"
              style="width: 100%">
              <a-input v-decorator="['energyConsumptionIntensity', {
            rules: [
              {
                required: true,
                message: '仅能输入数字和两位小数，不能为空或为负数！',
                pattern: /^[0-9]+\.?[0-9]{0,2}$/
              },
            ],
          }]" placeholder="请输入批发和零售业的值" suffix=""/>
            </a-form-item>
          </a-col>
        </a-row>
      </a-form>
      <a-button :loading="confirmLoading" class="button" icon="upload" type="primary" @click="handleOk()">提交</a-button>
    </a-spin>
  </a-card>
</template>

<script>
import pick from 'lodash.pick'
import { getAction } from '@api/manage'

const date = new Date()
const count = date.getFullYear() - 2020
const yearlist = []
for (let i = 0; i < count + 1; i++) {
  yearlist.push({
    name: date.getFullYear() - i,
    key: date.getFullYear() - i
  })
}

export default {
  name: 'industryProportion',
  data() {
    return {
      confirmLoading: false,
      title: '',
      visible: false,
      form: this.$form.createForm(this),
      dialogStyle: {
        top: '200px'
        // right:"20px",
      },
      labelCol: {
        // xs: { span: 24 },
        // sm: { span: 8 }
        span: 6
      },
      wrapperCol: {
        // xs: { span: 24 },
        // sm: { span: 16 }
        span: 12
      },
      // url: {
      //   add: '/carbon/carbonOverviewYearData/add',
      //   edit: '/carbon/carbonOverviewYearData/edit'
      // }
    }
  },
  created() {
  },
  mounted() {
    // this.getData()
  },
  methods: {

    openAdd() {
      this.$refs.modalForm.add()
      this.$refs.modalForm.title = '新增'
      this.$refs.modalForm.disableSubmit = false
    }
  }
}
</script>

<style lang="stylus" scoped>
.button {
  margin-left: 50%;
  transform: translateX(-50%);
}
</style>